/**
 * 
 */
package com.xjt.common;

import java.io.File;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author Jet Xu
 * 
 */
public class SystemInfo
{
    private static Map<String, String> map = new ConcurrentHashMap<String, String>();

    public static String getValue(String key)
    {
        return map.get(key);
    }

    public static void setValue(String key, String value)
    {
        map.put(key, value);
    }

    public static String getClassPath()
    {
        String fullPath = SystemInfo.class.getClassLoader().getResource(File.separator).getPath();

        String osName = System.getProperty("os.name");

        if (null != osName && null != fullPath)
        {
            // 如果为windows操作系统，则去掉之前的“/”
            if (osName.toUpperCase().startsWith("WIN"))
            {
                fullPath = fullPath.substring(1);
            }
        }

        return fullPath;
    }
}
